@model Adams.Admin.DataTransfer.Classifieds.Categories.PageLoad
@{
    Layout = "~/Views/Classifieds/_Layout.cshtml";
}
@section Head{
    <link rel="stylesheet" type="text/css" href="/Content/Classifieds/categories.css" />
}
<div class="content-box">
    <div class="content-box-header">
        <h3>
            Categories</h3>
    </div>
    <div class="content-box-content">
        <a href="#" id="create">Create New Type</a>
        <ul id="types">
            @foreach (var typ in Model.Types)
            {
                <li class="level1" id="@("t_" + typ.ID.ToString())">
                <a href="#" class="showhide">
                    <img src="@Url.Content("/Content/images/tree_plus.png")" /></a> 
                <span>@typ.Name</span>
                    @if (typ.Categories.Count == 0)
                    {
                        <a href="#" class="typedelete">
                            <img src="@Url.Content("/Content/images/cross.png")" alt="delete" /></a>
                    }
                    <a href="#" class="typeedit">
                        <img src="@Url.Content("/Content/images/pencil.png")" alt="Edit" /></a> <a href="#"
                            class="typeadd">
                            <img src="@Url.Content("/Content/images/add.png")" alt="Add" /></a>
                    <ul id="@("tul_" + typ.ID.ToString())" class="hidden">
                        @foreach (var cat in typ.Categories)
                        {
                            <li class="level2" id="@("c_" + cat.ID.ToString())"><span>@cat.Name</span> <a href="#"
                                class="catdelete">
                                <img src="@Url.Content("/Content/images/cross.png")" alt="delete" /></a> <a href="#"
                                    class="catedit">
                                    <img src="@Url.Content("/Content/images/pencil.png")" alt="Edit" /></a></li>
                        }
                    </ul>
                </li>
            }
        </ul>
        <div class="clear">
        </div>
    </div>
</div>
<div id="edittypebox" class="content-box hidden" style="width: 50%;">
    <div class="content-box-header">
        <h3>
            Edit Type</h3>
    </div>
    <div class="content-box-content">
        <form action="" method="post">
        <p>
            <label>
                Name</label>
            <input class="text-input medium-input" type="text" id="TypeName" value="" />
            <br />
            <small></small>
        </p>
        <p>
            <input class="button" id="typesubmit" type="button" value="Submit" />
            <input class="button" id="typecancel" type="button" value="Cancel" />
        </p>
        <div class="clear">
        </div>
        <input id="TypeID" type="hidden" value="" />
        </form>
    </div>
</div>
<div id="editcatbox" class="content-box hidden" style="width: 50%;">
    <div class="content-box-header">
        <h3>
            Edit Category</h3>
    </div>
    <div class="content-box-content">
        <form action="" method="post">
        <p>
            <label>
                Name</label>
            <input class="text-input medium-input" type="text" id="CategoryName" value="" />
            <br />
            <small></small>
        </p>
        <p>
            <input class="button" id="catsubmit" type="button" value="Submit" />
            <input class="button" id="catcancel" type="button" value="Cancel" />
        </p>
        <div class="clear">
        </div>
        <input id="CategoryID" type="hidden" value="" />
        <input id="CategoryTypeID" type="hidden" value="" />
        </form>
    </div>
</div>
@section Scripts {
    <script type="text/javascript" src="@Url.Content("/Scripts/Classifieds/categories.js")"></script>
}
